package com.hexb.arithmetic.astart
{
	import com.hexb.Utils;
	
	import flash.display.Graphics;

	public class AStartTestTools
	{
		public function AStartTestTools()
		{
		}
		
		static public function drawGrid(g:Graphics,grid:Array,width:Number=20,height:Number=20,
										openColor:uint=0x990000,closeColor:uint=0x000000,
										offsetX:Number=0,offsetY:Number=0):void{
			var x:int ;
			var y:int ;
			for(y=0;y<grid.length;y++){
				for(x=0;x<grid[y].length;x++){
					g.lineStyle(1,0xcccccc,1);
					g.beginFill(grid[y][x]>=7 ? closeColor : openColor,1);
					g.drawRect(x*width+offsetX,y*height+offsetY,width,height);
					g.endFill();
				}
			}
		}
		
		static public function drawPoint(g:Graphics,p:APoint,color:uint=0x00ff00,width:Number=20,height:Number=20,
										offsetX:Number=0,offsetY:Number=0):void{
			var x:int = p.x;
			var y:int = p.y;
			g.lineStyle(1,0xcccccc,1);
			g.beginFill(color,1);
			g.drawRect(x*width+offsetX,y*height+offsetY,width,height);
			g.endFill();
		}
	}
}